package net.chathu.airgw.packets.gw.clientpackets
{
	import net.chathu.airgw.Config;
	import net.chathu.airgw.model.Room;
	import net.chathu.airgw.packets.gw.serverpackets.ChannelModePacket;
	
	/**
	 * ...
	 * @author ze
	 */
	public class CMDMode extends IRCReceivablePacket
	{
		
		public function CMDMode()
		{
		
		}
		
		override public function execute():void
		{
			try
			{
				if (data.length > 1)
				{
					var roomName:String = data[1];
					if (sessionData.chatData)
					{
						var room:Room = sessionData.chatData.rooms.getRoomByName(roomName);
						if (room)
						{
							sendToClient(new ChannelModePacket(sessionData.nick, roomName, "+"));
						}
						else
						{
							//TODO: missing code!
						}
					}
				}
			}
			catch (err:Error)
			{
				trace(err);
			}
		}
		
		public static function getShortUsageDescription():String
		{
			return "Mód lekérdezés (" + Config.IRC_CHAR_COLOR + "4nincs implementálva" + Config.IRC_CHAR_COLOR + ")";
		}
	
	}

}